getItem = name => {
    const data = window.localStorage.getItem(name)
    try {
        return JSON.parse(data)
    } catch {
        return data
    }
}
setItem= (name, value) => {
    if (typeof value === 'object') {
        let data = JSON.stringify(value);
        window.localStorage.setItem(name, data);
    } else {
        window.localStorage.setItem(name, value);
    }

}
removeItem= name => {
    window.localStorage.removeItem(name);
}
module.exports = {
    getItem,
    setItem,
    removeItem
}